package net.flyinggroup.scs.gitter.domain;

import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;
import java.util.Set;

@Data
@Builder
@Document
@NoArgsConstructor
@AllArgsConstructor(staticName = "of", onConstructor_ = @PersistenceConstructor)
public class Message {
    @Id
    @NonNull
    private String id;
    @NonNull
    private String text;
    @NonNull
    private String html;
    @NonNull
    private Date sent;
    @NonNull
    private User user;
    @NonNull
    private Boolean unread;
    @NonNull
    private Long readBy;
    @NonNull
    private String[] urls;
    @NonNull
    private Set<Mention> mentions;
    @NonNull
    private Set<Issue> issues;
}